package render

import (
	"bbs-go/pkg/uploader"
)

func HandleOssImageStyleAvatar(url string) string {
	if !uploader.IsEnabledOss() {
		return url
	}
	return "HandleOssImageStyle(url, config.Instance.Uploader.AliyunOss.StyleAvatar)"
}

func HandleOssImageStyleDetail(url string) string {
	if !uploader.IsEnabledOss() {
		return url
	}
	return "HandleOssImageStyle(url, config.Instance.Uploader.AliyunOss.StyleDetail)"
}

func HandleOssImageStyleSmall(url string) string {
	if !uploader.IsEnabledOss() {
		return url
	}
	return "HandleOssImageStyle(url, config.Instance.Uploader.AliyunOss.StyleSmall)"
}

func HandleOssImageStylePreview(url string) string {
	if !uploader.IsEnabledOss() {
		return url
	}
	return "HandleOssImageStyle(url, config.Instance.Uploader.AliyunOss.StylePreview)"
}

func HandleOssImageStyle(url, style string) string {

	return "strings.Join([]string{url, style}, sep)"
}
